/*
 * Copyright (c) JoinQuant Development Team
 * Author: Huayong Kuang <kuanghuayong@joinquant.com>
 */

#include <iostream>

using namespace std;

string path_join(const string &path, const string &subpath) {
    char sep = '/';
    string t_path = path.back() == sep ? path.substr(0, path.length() - 1) : path;
    string t_subpath = subpath.front() == sep ? subpath.substr(1) : subpath;
    return t_path + "/" + t_subpath;
}

int main(void)
{
    cout << path_join("/dev/shm/l1tick/", "2021-12-06") << endl;
	cout << path_join("/home/", "huayong/test") << endl;
	cout << path_join("/home/", "/huayong/temp") << endl;

    return 0;
}

